{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Vibronic structure"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction \n",
    "\n",
    "The molecular Hamiltonian is \n",
    "\n",
    "$$\n",
    "\\mathcal{H} = - \\sum_I \\frac{\\nabla_{R_I}^2}{M_I} - \\sum_i \\frac{\\nabla_{r_i}^2}{m_e} - \\sum_I\\sum_i  \\frac{Z_I e^2}{|R_I-r_i|} + \\sum_i \\sum_{j>i} \\frac{e^2}{|r_i-r_j|} + \\sum_I\\sum_{J>I} \\frac{Z_I Z_J e^2}{|R_I-R_J|}\n",
    "$$\n",
    "\n",
    "Because the nuclei are much heavier than the electrons they do not move on the same time scale and therefore, the behavior of nuclei and electrons can be decoupled. This is the Born-Oppenheimer approximation.\n",
    "\n",
    "Within the Born-Oppenheimer approximation, a molecular wave function is factorized as a product of an electronic part, which is the solution of the electronic Schroedinger equation, and a vibro-rotational one, which is the solution of the nuclear Schroedinger equation in the potential energy surface (PES) generated by sampling the eigenvalues of the electronic Schroedinger equation for different geometries.\n",
    "\n",
    "The nuclear Schroedinger equation is usually solved in two steps, in analogy with its electronic counterpart. \n",
    "A single-particle basis (the basis functions are called, in this case, modals) is obtained either by the harmonic approximation applied to the PES or from a vibrational self-consistent field (VSCF) calculation. \n",
    "Vibrational anharmonic correlations are added a-posteriori with perturbative or variational approaches.\n",
    "The latter include Vibrational Configuration Interaction (VCI) and Vibrational Coupled Cluster (VCC) for highly-accurate anharmonic energies. \n",
    "The main advantage of VCI and VCC over alternative approaches (such as perturbation theories) is that their accuracy can be systematically improved towards the complete basis set limit for a given PES. \n",
    "However, their applicability is limited to small molecules with up to about 10 atoms due to their unfavorable scaling with system size.\n",
    "\n",
    "To tackle the scaling problem we would like to use quantum algorithms.\n",
    "\n",
    "The nuclear Schroedinger equation is\n",
    "$$\n",
    "\\mathcal{H}_{\\text{vib}} |\\Psi_{n}\\rangle = E_{n} |\\Psi_{n}\\rangle\n",
    "$$\n",
    "\n",
    "The so-called Watson Hamiltonian (neglecting vibro-rotational coupling terms) is\n",
    "$$\n",
    "  \\mathcal{H}_\\text{vib}(Q_1, \\ldots, Q_L) \n",
    "    = - \\frac{1}{2} \\sum_{l=1}^{L} \\frac{\\partial^2}{\\partial Q_l^2} + V(Q_1, \\ldots, Q_L)\n",
    "$$\n",
    "where $Q_l$ are the harmonic mass-weighted normal coordinates.\n",
    "\n",
    "$\\mathcal{H}_\\text{vib}$ must be mapped to an operator that acts on the states of a given set of $N_q$ qubits in order to calculate its eigenfunctions on quantum hardware.\n",
    "In electronic structure calculations, the mapping is achieved by expressing the non-relativistic electronic Hamiltonian in second quantization, \\textit{i.e.} by projecting it onto the complete set of antisymmetrized occupation number vectors (ONV) generated by a given (finite) set of orbitals.\n",
    "To encode the vibrational Hamiltonian in an analogous second quantization operators, we expand the potential $V(Q_1, \\ldots, Q_L)$ with the $n$-body expansion as follows:\n",
    "\n",
    "$$\n",
    "  V(Q_1, \\ldots, Q_L) = V_0 + \\sum_{l=1}^L V^{[l]}(Q_l) \n",
    "    + \\sum_{l<m}^L V^{[l,m]}(Q_l, Q_m) + \\sum_{l<m<n}^L V^{[l,m,n]}(Q_l, Q_m, Q_n) + \\ldots\n",
    "$$\n",
    "\n",
    "where $V_0$ is the electronic energy of the reference geometry, the one-mode term $V^{[l]}(Q_l)$ represents the variation of the PES upon change of the $l$-th normal coordinate from the equilibrium position.\n",
    "Similarly, the two-body potential $V^{[l,m]}(Q_l, Q_m)$ represents the change in the exact PES upon a simultaneous displacement along the $l$-th and $m$-th coordinates. \n",
    "Often, including terms up to three-body in the $L$-body expansion is sufficient to obtain an accuracy of about 1~cm$^{-1}$. We highlight that the many-body expansion of the potential operator defining the Watson Hamiltonian contains arbitrarily high coupling terms. This is a crucial difference compared to the non-relativistic electronic-structure Hamiltonian that contains only pairwise interactions.\n",
    "\n",
    "A flexible second quantization form of the Watson Hamiltonian is obtained within the so-called n-mode representation. Let us assume that each mode $l$ is described by a $N_l$-dimensional basis set $S_l$ defined as follows:\n",
    "\n",
    "$$\n",
    "  \\mathcal{S}_l = \\{ \\phi_1^{(l)} (Q_l) , \\ldots , \\phi_{N_l}^{(l)} (Q_l) \\} \\, .\n",
    "$$\n",
    "\n",
    "The $n$-mode wave function can be expanded in the product basis $\\mathcal{S} = \\otimes_{i=1}^L \\mathcal{S}_i$ as the following CI-like expansion:\n",
    "\n",
    "$$\n",
    "  |\\Psi\\rangle = \\sum_{k_1=1}^{N_1} \\cdots \\sum_{k_L=1}^{N_L} C_{k_1,\\ldots,k_L} \n",
    "    \\phi_{k_1}^{(1)}(Q_1) \\cdots \\phi_{k_L}^{(L)}(Q_L) \\, ,\n",
    "$$\n",
    "\n",
    "The many-body basis function $\\phi_{k_1}^{(1)}(Q_1) \\cdots \\phi_{k_L}^{(L)}(Q_L)$ are encoded within the so-called $n$-mode second quantization as occupation-number vectors (ONVs) as follows:\n",
    "\n",
    "$$\n",
    "  \\phi_{k_1}(Q_1) \\cdots \\phi_{k_L}(Q_L)\n",
    "                      \\equiv  |0_1 \\cdots 1_{k_1} \\cdots 0_{N_1},\n",
    "                                   0_1 \\cdots 1_{k_2} \\cdots 0_{N_2}, \n",
    "                                   \\cdots , \n",
    "                                   0_1 \\cdots 1_{k_L} \\cdots 0_{N_L}\\rangle \\, .\n",
    "$$\n",
    "\n",
    "The ONV defined above is, therefore, the product of $L$ mode-specific ONVs, each one describing an individual mode. Since each mode is described by one and only one basis function, the occupation of each mode-specific ONV is one.\n",
    "From a theoretical perspective, each mode can be interpreted as a distinguishable quasi-particle (defined as phonons in solid-state physics). Distinguishability arises from the fact that the PES is not invariant by permutation of two modes, also in this case unlike the Coulomb interaction between two equal particles. From this perspective, a molecule can be interpreted as a collection of $L$ indistinguishable particles that interact through the PES operator.\n",
    "\n",
    "Based on this second-quantization representation we introduce a pair of creation and annihilation operators per mode $l$ \\textit{and} per basis function $k_l$ defined as:\n",
    "\n",
    "$$\n",
    "  \\begin{aligned}\n",
    "    a_{k_l}^\\dagger |\\cdots, 0_1 \\cdots 0_{k_l} \\cdots 0_{N_l}, \\cdots\\rangle \n",
    "      &=  | \\cdots, 0_1 \\cdots 1_{k_l} \\cdots 0_{N_l}, \\cdots\\rangle \\\\\n",
    "    a_{k_l}^\\dagger | \\cdots, 0_1 \\cdots 1_{k_l} \\cdots 0_{N_l}, \\cdots\\rangle &=  0 \\\\\n",
    "    a_{k_l} | \\cdots, 0_1 \\cdots 1_{k_l} \\cdots 0_{N_l}, \\cdots\\rangle\n",
    "     &= | \\cdots, 0_1 \\cdots 0_{k_l} \\cdots 0_{N_l}, \\cdots\\rangle \\\\\n",
    "    a_{k_l} | \\cdots, 0_1 \\cdots 0_{k_l} \\cdots 0_{N_l}, \\cdots\\rangle &=  0 \\\\\n",
    "  \\end{aligned}\n",
    "$$\n",
    "\n",
    "with\n",
    "\n",
    "$$\n",
    "  \\begin{aligned}\n",
    "    \\left[ a_{k_l}^\\dagger, a_{h_m}^\\dagger \\right] &= 0 \\\\\n",
    "    \\left[ a_{k_l}, a_{h_m} \\right] &= 0 \\\\\n",
    "    \\left[ a_{k_l}^\\dagger, a_{h_m} \\right] &= \\delta_{l,m} \\, , \\delta_{k_l,h_m}\n",
    "  \\end{aligned}\n",
    "$$\n",
    "\n",
    "The second quantization form is obtained by expressing the potential as \n",
    "\n",
    "$$\n",
    " \\begin{aligned}\n",
    "  \\mathcal{H}_\\text{vib}^{SQ} =& \\sum_{l=1}^L \n",
    "    \\sum_{k_l,h_l}^{N_l} \\langle \\phi_{k_l} | T(Q_l) + V^{[l]}(Q_l) | \\phi_{h_l} \\rangle a_{k_l}^+ a_{h_l} \\\\\n",
    " +& \\sum_{l<m}^L \\sum_{k_l,h_l}^{N_l} \\sum_{k_m,h_m}^{N_m}\n",
    "    \\langle \\phi_{k_l} \\phi_{k_m} | V^{[l,m]}(Q_l, Q_m) | \\phi_{h_l} \\phi_{h_m} \\rangle \n",
    "    a_{k_l}^+ a_{k_m}^+ a_{h_l} a_{h_m} + \\cdots\n",
    " \\end{aligned}\n",
    "$$\n",
    "\n",
    "We highlight here the difference between the operators defined here above and the electronic structure one. First, as we already mentioned, the potential contains (in principle) three- and higher-body coupling terms that lead to strings with six (or more) second-quantization operators. \n",
    "Moreover, the Hamiltonian conserves the number of particles for each mode, as can be seen from the fact that the number of creation and annihilation operators for a given mode is the same in each term. Nevertheless, different modes are coupled by two- (and higher) body terms containing SQ operators belonging to different modes $l$ and $m$.\n",
    "\n",
    "Reference: Ollitrault, Pauline J., et al., arXiv:2003.12578 (2020)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Compute the electronic potential\n",
    "\n",
    "Solving the ESE for different nuclear configurations to obtain the PES function $V(Q_1, \\ldots, Q_L)$. So far Qiskit gives the possibility to approximate the PES with a quartic force field. \n",
    "$$\n",
    "V(Q_1, \\ldots, Q_L) = \\frac{1}{2}  \\sum_{ij} k_{ij} Q_i Q_j\n",
    "                  + \\frac{1}{6}  \\sum_{ijk} k_{ijk} Q_i Q_j Q_k\n",
    "                  + \\frac{1}{16} \\sum_{ijkl} k_{ijkl} Q_i Q_j Q_k Q_l\n",
    "$$\n",
    "The advantage of such form for the PES is that the anharmonic force fields ($k_{ij}$, $k_{ijk}$, $k_{ijkl}$) can be calculated by finite-difference approaches. For methods for which the nuclear energy Hessian can be calculated analytically with response theory-based methods (such as HF and DFT), the quartic force field can be calculated by semi-numerical differentiation as:\n",
    "$$\n",
    "k_{ijk} = \\frac{H_{ij}(+\\delta Q_k) - H_{ij}(-\\delta Q_k)}{2\\delta Q_k}\n",
    "$$\n",
    "and\n",
    "$$\n",
    "k_{ijkl} = \\frac{H_{ij}(+\\delta Q_k+\\delta Q_l) - H_{ij}(+\\delta Q_k-\\delta Q_l)\n",
    "                    -H_{ij}(-\\delta Q_k+\\delta Q_l) + H_{ij}(-\\delta Q_k+\\delta Q_l)}\n",
    "                    {4\\delta Q_k \\delta Q_l}\n",
    "$$\n",
    "Such numerical procedure is implemented, for instance, in the Gaussian suite of programs.\n",
    "\n",
    "In practice this can be done with Qiskit using the GaussianForceDriver. \n",
    "       "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from qiskit.chemistry.drivers import GaussianForcesDriver\n",
    "# if you ran Gaussian elsewhere and already have the output file\n",
    "driver = GaussianForcesDriver(logfile='aux_files/CO2_freq_B3LYP_ccpVDZ.log')\n",
    "\n",
    "# if you want to run the Gaussian job from Qiskit\n",
    "# driver = GaussianForcesDriver(\n",
    "#                 ['#p B3LYP/6-31g Freq=(Anharm) Int=Ultrafine SCF=VeryTight',\n",
    "#                  '',\n",
    "#                  'CO2 geometry optimization B3LYP/6-31g',\n",
    "#                  '',\n",
    "#                  '0 1',\n",
    "#                  'C  -0.848629  2.067624  0.160992',\n",
    "#                  'O   0.098816  2.655801 -0.159738',\n",
    "#                  'O  -1.796073  1.479446  0.481721',\n",
    "#                  '',\n",
    "#                  ''"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Map to a qubit Hamiltonian\n",
    "\n",
    "Now that we have an approximation for the potential, we need to write the Hamiltonian in second quantization. To this end we need to select a modal basis to calculate the one-body integrals $\\langle\\phi_{k_i}| V(Q_i) | \\phi_{h_i} \\rangle$, two-body integrals $\\langle\\phi_{k_i} \\phi_{k_j}| V(Q_i,Q_j) | \\phi_{h_i} \\phi_{h_j} \\rangle$... \n",
    "\n",
    "In the simplest case, the $\\phi$ functions are the harmonic-oscillator eigenfunctions for each mode. The main advantage of this choice is that the integrals of a PES expressed as a Taylor expansion are easy to calculate with such basis. A routine for computing these integrals is implemented in Qiskit. \n",
    "\n",
    "The bosonic operator, $\\mathcal{H}_\\text{vib}^{SQ}$, is then created and must be mapped to a qubit operator. The direct mapping introduced in the first section of this tutorial can be used is Qiskit as follows:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "from qiskit.chemistry.transformations import (BosonicTransformation,\n",
    "                                              BosonicTransformationType, # type of modal basis\n",
    "                                              BosonicQubitMappingType) # type of boson to qubit mapping\n",
    "\n",
    "bosonic_transformation = BosonicTransformation(qubit_mapping=BosonicQubitMappingType.DIRECT,\n",
    "                                               transformation_type=BosonicTransformationType.HARMONIC,\n",
    "                                               basis_size=2, \n",
    "                                               truncation=2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the previous cell we defined a bosonic transformation to express the Hamiltonian in the harmonic modal basis, with 2 modals per mode with the potential truncated at order 2 and the 'direct' boson to qubit mapping. \n",
    "The calculation is then ran as:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "IIIIIIII\t(5077.2365606250005+0j)\n",
      "IIIIIIIZ\t(-601.9000340625+0j)\n",
      "IIIIIIZI\t(-1810.6538965625004+0j)\n",
      "IIIIIZII\t(-342.04261812500005+0j)\n",
      "IIIIXXII\t(-84.41897986727395+0j)\n",
      "IIIIYYII\t(-84.41897986727395+0j)\n",
      "IIIIZIII\t(-1027.4430731250004+0j)\n",
      "IIIZIIII\t(-155.20426031250003+0j)\n",
      "IIZIIIII\t(-467.50585156250014+0j)\n",
      "IZIIIIII\t(-157.22939093750003+0j)\n",
      "ZIIIIIII\t(-472.28961593750006+0j)\n",
      "IIIIIZIZ\t(1.2599134375000005+0j)\n",
      "IIIIIZZI\t(3.779740312500002+0j)\n",
      "IIIIXXIZ\t(22.272716326623776+0j)\n",
      "IIIIYYIZ\t(22.272716326623776+0j)\n",
      "IIIIXXZI\t(66.81814897987134+0j)\n",
      "IIIIYYZI\t(66.81814897987134+0j)\n",
      "IIIIZIIZ\t(3.779740312500002+0j)\n",
      "IIIIZIZI\t(11.339220937500007+0j)\n",
      "IIIZIIIZ\t(-1.5962606250000009+0j)\n",
      "IIIZIIZI\t(-4.788781875000002+0j)\n",
      "IIIZIZII\t(-0.6414307812500002+0j)\n",
      "IIIZXXII\t(-5.411241592930711+0j)\n",
      "IIIZYYII\t(-5.411241592930711+0j)\n",
      "IIIZZIII\t(-1.9242923437500008+0j)\n",
      "IIXXIIXX\t(-0.5021409375000001+0j)\n",
      "IIYYIIXX\t(-0.5021409375000001+0j)\n",
      "IIXXIIYY\t(-0.5021409375000001+0j)\n",
      "IIYYIIYY\t(-0.5021409375000001+0j)\n",
      "IIZIIIIZ\t(-4.788781875000002+0j)\n",
      "IIZIIIZI\t(-14.366345625000008+0j)\n",
      "IIZIIZII\t(-1.924292343750001+0j)\n",
      "IIZIXXII\t(-16.233724778792137+0j)\n",
      "IIZIYYII\t(-16.233724778792137+0j)\n",
      "IIZIZIII\t(-5.772877031250004+0j)\n",
      "IZIIIIIZ\t(-1.1489604687500004+0j)\n",
      "IZIIIIZI\t(-3.4468814062500015+0j)\n",
      "IZIIIZII\t(-0.42099484375000024+0j)\n",
      "IZIIXXII\t(-1.6031887335286772+0j)\n",
      "IZIIYYII\t(-1.6031887335286772+0j)\n",
      "IZIIZIII\t(-1.2629845312500008+0j)\n",
      "IZIZIIII\t(-0.13775546875000005+0j)\n",
      "IZZIIIII\t(-0.4132664062500002+0j)\n",
      "XXIIIIXX\t(0.8980418750000001+0j)\n",
      "YYIIIIXX\t(0.8980418750000001+0j)\n",
      "XXIIIIYY\t(0.8980418750000001+0j)\n",
      "YYIIIIYY\t(0.8980418750000001+0j)\n",
      "XXXXIIII\t(1.986637812500001+0j)\n",
      "YYXXIIII\t(1.986637812500001+0j)\n",
      "XXYYIIII\t(1.986637812500001+0j)\n",
      "YYYYIIII\t(1.986637812500001+0j)\n",
      "ZIIIIIIZ\t(-3.4468814062500015+0j)\n",
      "ZIIIIIZI\t(-10.340644218750004+0j)\n",
      "ZIIIIZII\t(-1.2629845312500005+0j)\n",
      "ZIIIXXII\t(-4.809566200586032+0j)\n",
      "ZIIIYYII\t(-4.809566200586032+0j)\n",
      "ZIIIZIII\t(-3.7889535937500023+0j)\n",
      "ZIIZIIII\t(-0.4132664062500002+0j)\n",
      "ZIZIIIII\t(-1.2397992187500007+0j)\n",
      "\n",
      "\n",
      "The total number of modes in this system is 4\n"
     ]
    }
   ],
   "source": [
    "qubit_op, _ = bosonic_transformation.transform(driver)\n",
    "print(qubit_op.print_details())\n",
    "\n",
    "print('\\nThe total number of modes in this system is {}'.format(bosonic_transformation.num_modes))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To have a different number of modals per mode:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "IIIIII\t(3309.8257831250007+0j)\n",
      "IIIIIZ\t(-164.15502593750006+0j)\n",
      "IIIXIX\t(1.8979435436158592+0j)\n",
      "IIIYIY\t(1.8979435436158592+0j)\n",
      "IIIIZI\t(-494.3581484375001+0j)\n",
      "IIXIXI\t(6.378706032974414+0j)\n",
      "IIYIYI\t(6.378706032974414+0j)\n",
      "IIIZII\t(-828.3474121875001+0j)\n",
      "IIZIII\t(-1166.1228171875002+0j)\n",
      "IZIIII\t(-161.85614656250007+0j)\n",
      "ZIIIII\t(-486.16988281250013+0j)\n",
      "IZIIIZ\t(-0.13775546875000005+0j)\n",
      "IZIXIX\t(0.19481565219731314+0j)\n",
      "IZIYIY\t(0.19481565219731314+0j)\n",
      "IZIIZI\t(-0.4132664062500002+0j)\n",
      "IZXIXI\t(0.3374306077154137+0j)\n",
      "IZYIYI\t(0.3374306077154137+0j)\n",
      "IZIZII\t(-0.6887773437500002+0j)\n",
      "IZZIII\t(-0.9642882812500004+0j)\n",
      "XXIIXX\t(1.986637812500001+0j)\n",
      "YYIIXX\t(1.986637812500001+0j)\n",
      "XXIIYY\t(1.986637812500001+0j)\n",
      "YYIIYY\t(1.986637812500001+0j)\n",
      "XXXIIX\t(0.8288402231450827+0j)\n",
      "YYXIIX\t(0.8288402231450827+0j)\n",
      "XXYIIY\t(0.8288402231450827+0j)\n",
      "YYYIIY\t(0.8288402231450827+0j)\n",
      "XXIXXI\t(4.245123515804727+0j)\n",
      "YYIXXI\t(4.245123515804727+0j)\n",
      "XXIYYI\t(4.245123515804727+0j)\n",
      "YYIYYI\t(4.245123515804727+0j)\n",
      "XXXXII\t(6.957428881323849+0j)\n",
      "YYXXII\t(6.957428881323849+0j)\n",
      "XXYYII\t(6.957428881323849+0j)\n",
      "YYYYII\t(6.957428881323849+0j)\n",
      "ZIIIIZ\t(-0.4132664062500002+0j)\n",
      "ZIIXIX\t(0.5844469565919395+0j)\n",
      "ZIIYIY\t(0.5844469565919395+0j)\n",
      "ZIIIZI\t(-1.2397992187500007+0j)\n",
      "ZIXIXI\t(1.0122918231462412+0j)\n",
      "ZIYIYI\t(1.0122918231462412+0j)\n",
      "ZIIZII\t(-2.066332031250001+0j)\n",
      "ZIZIII\t(-2.8928648437500013+0j)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "bosonic_transformation_2 = BosonicTransformation(qubit_mapping=BosonicQubitMappingType.DIRECT,\n",
    "                                               transformation_type=BosonicTransformationType.HARMONIC,\n",
    "                                               basis_size=[0,0,4,2], \n",
    "                                               truncation=2)\n",
    "qubit_op_2, _ = bosonic_transformation_2.transform(driver)\n",
    "print(qubit_op_2.print_details())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now that the Hamiltonian is ready, it can be used in a quantum algorithm to find information about the vibronic structure of the corresponding molecule. Check out our tutorials on Ground State Calculation and Excited States Calculation to learn more about how to do that in Qiskit!"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<h3>Version Information</h3><table><tr><th>Qiskit Software</th><th>Version</th></tr><tr><td>Qiskit</td><td>0.23.0</td></tr><tr><td>Terra</td><td>0.16.0</td></tr><tr><td>Aer</td><td>0.7.0</td></tr><tr><td>Ignis</td><td>0.5.0</td></tr><tr><td>Aqua</td><td>0.8.0</td></tr><tr><td>IBM Q Provider</td><td>0.11.0</td></tr><tr><th>System information</th></tr><tr><td>Python</td><td>3.7.4 (default, Aug 13 2019, 15:17:50) \n",
       "[Clang 4.0.1 (tags/RELEASE_401/final)]</td></tr><tr><td>OS</td><td>Darwin</td></tr><tr><td>CPUs</td><td>6</td></tr><tr><td>Memory (Gb)</td><td>16.0</td></tr><tr><td colspan='2'>Wed Oct 21 12:22:51 2020 CEST</td></tr></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<div style='width: 100%; background-color:#d5d9e0;padding-left: 10px; padding-bottom: 10px; padding-right: 10px; padding-top: 5px'><h3>This code is a part of Qiskit</h3><p>&copy; Copyright IBM 2017, 2020.</p><p>This code is licensed under the Apache License, Version 2.0. You may<br>obtain a copy of this license in the LICENSE.txt file in the root directory<br> of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.<p>Any modifications or derivative works of this code must retain this<br>copyright notice, and modified files need to carry a notice indicating<br>that they have been altered from the originals.</p></div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import qiskit.tools.jupyter\n",
    "%qiskit_version_table\n",
    "%qiskit_copyright"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
